﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CANLib
{
    public partial class ucPacketDetailView : UserControl
    {
        #region ctor

        public ucPacketDetailView()
        {
            InitializeComponent();
        }

        #endregion

        #region Members

        private CANPacket mActivePacket = null;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the active packet that should be shown
        /// </summary>
        public CANPacket ActivePacket
        {
            get
            {
                return mActivePacket;
            }
            set
            {
                mActivePacket = value;
                UpdatePacket();
            }
        }

        #endregion

        #region Methods

        /// <summary>
        /// Updates all controls that display information about the active packet
        /// </summary>
        private void UpdatePacket()
        {
            if (mActivePacket != null)
            {
                label1.Text = mActivePacket.ID.ToString();
            }
        }

        #endregion

        #region Events

        #endregion
    }
}
